#!/bin/sh

set -e

PKG="kvm"
# KVM versioning is "fun"
PKGVER=`dpkg-query -W -f='${Version}' "$PKG"-source | cut -d: -f2 | cut -f1 -d+`

case "$1" in
	remove|upgrade)
		echo "Removing all [$PKG-$PKGVER] DKMS Modules"
		dkms remove -m $PKG -v $PKGVER --all >/dev/null || true
		echo "Done."
	;;
esac

#DEBHELPER#
